﻿'Params
'tag (Required) : The tag name
'from (Optional) : The date at which the chart should start from. See Tag.getWeeklyChartList for more.
'to (Optional) : The date at which the chart should end on. See Tag.getWeeklyChartList for more.
'limit (Optional) : The number of results to fetch per page. Defaults to 50.
'api_key (Required) : A Last.fm API key.
'Auth
'This service does not require authentication. 

Public Structure TagGetWeeklyArtistChartResponse
	Public chart As Chart

End Structure

Public Class TagGetWeeklyArtistChart
	Inherits BaseRequest

	Dim tag As String = ""
	Dim to_ As String = ""
	Dim from_ As String = ""
	Dim limit As String = ""

	Public xmlresponse As XDocument = Nothing

	Public Sub New(tag As String, from_ As String, to_ As String, limit As String)
		Me.tag = tag
		Me.from_ = from_
		Me.to_ = to_
		Me.limit = limit

	End Sub

	Public Sub sendRequest()
		InitializeMembers("tag.getWeeklyArtistChart")

		AddMember("to", to_, False)
		AddMember("tag", Tag, True)
		AddMember("from", from_, False)
		AddMember("limit", limit, False)
		AddMember("api_key", My.Settings.api_key, False)

		xmlresponse = sendPOSTResponse()
	End Sub

	Public Function getResponse() As TagGetWeeklyArtistChartResponse
		Dim response As New TagGetWeeklyArtistChartResponse
		response.chart = New Chart(xmlresponse.<lfm>.<weeklyartistchart>)	  'TODO: make sure it references the correct tag chart
		Return response
	End Function
End Class
